-
Notifications
You must be signed in to change notification settings - Fork 103
feat: Add glob support for package name in matchspec #1480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| let base_url = repo_data.info.as_ref().and_then(|i| i.base_url.as_deref()); | ||
| for (package_name, specs) in &spec.into_iter().chunk_by(|spec| spec.borrow().name.clone()) { | ||
| let grouped_specs = specs.into_iter().collect::<Vec<_>>(); | ||
| // TODO: support glob/regex package names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@baszalmstra ready for review! once this is merged, i can make the config for conda-mirror a bit easier to use! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two smaller comments. Looks good to me :)
crates/rattler_solve/tests/snapshots/backends__resolvo__issue_717.snap
Outdated
Show resolved
Hide resolved
| MatchSpec::from_nameless(NamelessMatchSpec::from_str(">=12", Strict).unwrap(), None); | ||
| assert!(!spec.is_virtual()); | ||
|
|
||
| let spec = MatchSpec::from_str("__virtual_glob*", Strict).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I see this I wonder if we should add a third mode for the parsing or a new constrcutor because I would like to validate at parsing in rattler-build that we get exact matchspecs. Maybe something like from_str_wiht_matcher or Strict, Lenient, StrictWithMatcher, LenientWithMatcher ...
Description
for
rattler::install,rattler_solveandrattler_repodata_gatewayi didn't support globbed matchspecs to keep this pr manageable.instead, i behave exactly like when we had a nameless matchspec there (i.e. either skip or panic)
i don't think supporting them in
rattler_solvemakes much sense as there are no packages that have globbed packages as dependencies anyway.for
rattler_repodata_gateway, i do see some nice use cases (for examplepixi search jupyter*which is currently handled in a custom manner). let's move this to another pr: #1723